package com.eian.boot.common.core.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;

/**
 * 系统内部异常
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor(force = true)
public final class SystemException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = 1L;

    private final String message;


    public SystemException(String message, Throwable throwable) {
        super.setStackTrace(throwable.getStackTrace());
        this.message = message;
    }

    public SystemException(String message) {
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
